package io.github.yotta.export.web.iface;

import io.github.yotta.common.api.model.ApiPageRequest;
import io.github.yotta.export.core.export.ExcelDataExporter;
import io.github.yotta.export.core.utils.GenericTypeUtils;

/**
 * @author yotta
 * @date 2025/4/27
 */
public interface SpringExcelDataExporter<M, R extends ApiPageRequest> extends ExcelDataExporter<M, R> {

    default ExportParamConvert<R> paramConvert() {
        return new DefaultExportParamConvert<R>(
                GenericTypeUtils.getGenericInterfaceType(this.getClass(), SpringExcelDataExporter.class, 1)
        );
    }

    default Class<M> modelClass() {
        return GenericTypeUtils.getGenericInterfaceType(this.getClass(), SpringExcelDataExporter.class, 0);
    }
}
